Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shelter: show icon in header and footer (DEV-1177) #801

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

tglaz
Copy link
Contributor

@tglaz tglaz commented Dec 21, 2024

As a shelter-web user, I want to recognize the app by its logo

https://betterangels.atlassian.net/browse/DEV-1177

preview at: https://shelter.dev.betterangels.la/logo

Notes:

  • still need updated svg icon for SheltersLA text to match branding (in separate ticket)

Summary by Sourcery

New Features:

  • Display the Better Angels logo in the header and footer of the Shelter web app.

Copy link

sourcery-ai bot commented Dec 21, 2024

Reviewer's Guide by Sourcery

This pull request implements the display of the Better Angels logo in the header and footer of the Shelter web application.

Class diagram showing updated component structure

classDiagram
    class Header {
      +render() ReactElement
    }
    class Footer {
      +render() ReactElement
    }
    class BetterangelsLogoIcon {
      +render() ReactElement
    }
    Header --> BetterangelsLogoIcon : uses
    Footer --> BetterangelsLogoIcon : uses
    note for BetterangelsLogoIcon "New SVG icon component"
Loading

File-Level Changes

Change Details Files
Added the Better Angels logo to the header and footer.
  • Imported the BetterangelsLogoIcon component.
  • Added the BetterangelsLogoIcon component to the header and footer.
  • Added styling to position and color the logo.
apps/shelter-web/src/app/layout/header.tsx
apps/shelter-web/src/app/layout/footer.tsx
Added global styles for the brand yellow color.
  • Defined the brand yellow color in the global styles.
  • Included the brand yellow color in the tailwind config.
apps/shelter-web/src/assets/styles/global.css
apps/shelter-web/tailwind.config.js
Created the Better Angels logo SVG and component.
  • Created the SVG file for the logo.
  • Created a React component to wrap the SVG.
  • Exported the new component from the icons library.
libs/react/icons/src/lib/index.ts
libs/react/icons/src/lib/components/betterangelsLogo.tsx
libs/assets/src/icons/svg/better_angels/betterAngelsLogo.svg

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@tglaz tglaz changed the title shelter: show icon in header and footer shelter: show icon in header and footer (DEV-1177) Dec 21, 2024
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tglaz - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

return <header className={parentCss}>hello shelter-app</header>;
return (
<header className={parentCss}>
<div className="flex items-center">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider extracting the logo and text into a shared component to avoid duplication with the footer

This would make the codebase more maintainable and ensure consistent branding across components.

Suggested implementation:

import { ReactElement } from 'react';
import { BrandLogo } from '../components/BrandLogo';
      <BrandLogo size="small" />

You'll need to:

  1. Create a new file apps/shelter-web/src/app/components/BrandLogo.tsx with this content:
import { BetterangelsLogoIcon } from '@monorepo/react/icons';

type BrandLogoProps = {
  size?: 'small' | 'large';
};

export function BrandLogo({ size = 'small' }: BrandLogoProps): ReactElement {
  const logoHeight = size === 'small' ? 'h-4' : 'h-8';

  return (
    <div className="flex items-center">
      <BetterangelsLogoIcon className={`${logoHeight} text-brand-yellow`} />
      <div className="text-white flex ml-2 text-sm">
        <div className="font-normal">Shelters</div>
        <div className="font-semibold">LA</div>
      </div>
    </div>
  );
}
  1. Update the footer component to use:
<BrandLogo size="large" />

This creates a reusable component that maintains consistency while allowing for different sizes in different contexts.

<div className="font-semibold">LA</div>
</div>
</div>
<div className="mt-6 border-t-[0.5px] border-white pt-6 flex justify-end">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider using a standard border width instead of 0.5px for better cross-browser consistency

Sub-pixel values can render inconsistently across different browsers. Consider using 1px or a standard Tailwind border width class.

Suggested change
<div className="mt-6 border-t-[0.5px] border-white pt-6 flex justify-end">
<div className="mt-6 border-t border-white pt-6 flex justify-end">

@tglaz tglaz force-pushed the DEV-1177/shelter-logo-header-footer branch 3 times, most recently from 8826e58 to eed4494 Compare December 21, 2024 06:31
@tglaz tglaz force-pushed the DEV-1177/shelter-logo-header-footer branch from eed4494 to bc631fd Compare December 21, 2024 06:39
@tglaz tglaz self-assigned this Dec 21, 2024
Copy link

@johnr54321 johnr54321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tglaz ! Definitely looks better with the logo. When we do the official header and footer tickets with the designs we'll do any design clean up.

@tglaz tglaz merged commit 367ec79 into main Dec 23, 2024
8 checks passed
@tglaz tglaz deleted the DEV-1177/shelter-logo-header-footer branch December 23, 2024 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants